package jp.co.redfox.archclub.poker.hand;

import java.util.List;
import java.util.ArrayList;

import jp.co.redfox.archclub.poker.Card;
import jp.co.redfox.archclub.poker.Hand;

public class RoyalStraight implements HandRestriction {

    @Override
    public boolean matches(Hand hand) {
        List<Card> cards = new ArrayList<>();
        cards.addAll(hand.getCards());

        Card.sort(cards);

        try {
            if ("A".equals(cards.get(0).getNumber()) && "10".equals(cards.get(1).getNumber())
                    && "J".equals(cards.get(2).getNumber()) && "Q".equals(cards.get(3).getNumber())
                    && "K".equals(cards.get(4).getNumber()))
                return true;
        } catch (ArrayIndexOutOfBoundsException e) {
        }
        return false;
    }

    @Override
    public int getRequiredNumber(Hand hand) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public Card[] getChangeCards(Hand hand) {
        // TODO Auto-generated method stub
        return null;
    }

}
